package com.ruoyi.system.mapper;

import java.util.List;

import com.ruoyi.system.domain.MoveOrderInfo;
import com.ruoyi.system.domain.WarehouseOrderInfo;
import org.apache.ibatis.annotations.Select;

/**
 * 仓库订单详情Mapper接口
 * 
 * @author ruoyi
 * @date 2025-01-19
 */
public interface WarehouseOrderInfoMapper 
{
    /**
     * 查询仓库订单详情
     * 
     * @param id 仓库订单详情主键
     * @return 仓库订单详情
     */
    public WarehouseOrderInfo selectWarehouseOrderInfoById(Long id);

    /**
     * 查询仓库订单详情列表
     * 
     * @param warehouseOrderInfo 仓库订单详情
     * @return 仓库订单详情集合
     */
    public List<WarehouseOrderInfo> selectWarehouseOrderInfoList(WarehouseOrderInfo warehouseOrderInfo);

    /**
     * 新增仓库订单详情
     * 
     * @param warehouseOrderInfo 仓库订单详情
     * @return 结果
     */
    public int insertWarehouseOrderInfo(WarehouseOrderInfo warehouseOrderInfo);

    /**
     * 修改仓库订单详情
     * 
     * @param warehouseOrderInfo 仓库订单详情
     * @return 结果
     */
    public int updateWarehouseOrderInfo(WarehouseOrderInfo warehouseOrderInfo);

    /**
     * 删除仓库订单详情
     * 
     * @param id 仓库订单详情主键
     * @return 结果
     */
    public int deleteWarehouseOrderInfoById(Long id);

    /**
     * 批量删除仓库订单详情
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWarehouseOrderInfoByIds(Long[] ids);

    @Select("select * from warehouse_order_info where product_id=#{productId} and warehouse_position_id =#{targetWarehouseId}")
    public WarehouseOrderInfo selectWarehouseByPidAndWpid(MoveOrderInfo moveOrderInfo);

    @Select("select * from warehouse_order_info where product_id=#{productId} and warehouse_position_id =#{originalWarehouseId}")
    public WarehouseOrderInfo selectOldWarehouseByPidAndWpid(MoveOrderInfo moveOrderInfo);
}
